From: Sebastian Keller Date: Mon, 8 Dec 2014 18:53:39 +0000 (+0100) Subject: window-tracker: Fix pid based window/app association X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1926 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=186f9b2e2c169f6625b363689e707d7f9befbc2f;p=gnome-shell.git window-tracker: Fix pid based window/app association The lookup table used by get_app_from_window_pid contained only pids of apps launched by gnome-shell itself, but not pids of apps running before gnome-shell was (re-)started. Also the pids in that table might not even be the pid of the process that is actually showing the window if wrapper scripts are used. Instead use shell_window_tracker_get_app_from_pid which uses the pids from the windows themselves. This removes the only use of launched_pid_to_app which will be removed in the following commit. This fixes: https://bugzilla.gnome.org/show_bug.cgi?id=736527 --- diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index 5c490085e..deef1b46f 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -293,7 +293,7 @@ get_app_from_window_group (ShellWindowTracker *tracker, * @window: a #MetaWindow * * Check if the pid associated with @window corresponds to an - * application we launched. + * application. * * Return value: (transfer full): A newly-referenced #ShellApp, or %NULL */ @@ -312,7 +312,7 @@ get_app_from_window_pid (ShellWindowTracker *tracker, if (pid == -1) return NULL; - result = g_hash_table_lookup (tracker->launched_pid_to_app, GINT_TO_POINTER (pid)); + result = shell_window_tracker_get_app_from_pid (tracker, pid); if (result != NULL) g_object_ref (result);